package com.fsm.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author 翻山鸣
 * @since 2024/04/20
 */
public class TSystemUserTable extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final TSystemUserTable T_SYSTEM_USER = new TSystemUserTable();

    /**
     * 用户id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 存在
     */
    public final QueryColumn EXIST = new QueryColumn(this, "exist");

    /**
     * 密码
     */
    public final QueryColumn PASSWORD = new QueryColumn(this, "password");

    /**
     * 登录名
     */
    public final QueryColumn LOGIN_NAME = new QueryColumn(this, "login_name");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 修改时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 头像
     */
    public final QueryColumn HEAD = new QueryColumn(this, "head");

    /**
     * 联系电话
     */
    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    /**
     * 过期时间
     */
    public final QueryColumn EXPIRATION_TIME = new QueryColumn(this, "expiration_time");

    /**
     * 姓名
     */
    public final QueryColumn NAME = new QueryColumn(this, "name");

    /**
     * 公司名
     */
    public final QueryColumn COMPANY_NAME = new QueryColumn(this, "company_name");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, LOGIN_NAME, PASSWORD, CREATE_TIME, UPDATE_TIME, EXIST, HEAD, PHONE, EXPIRATION_TIME, NAME, COMPANY_NAME};

    public TSystemUserTable() {
        super("", "t_system_user");
    }

    private TSystemUserTable(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TSystemUserTable as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TSystemUserTable("", "t_system_user", alias));
    }

}
